package pl.edu.agh.thieves.firefly;

import java.util.ArrayList;

import pl.edu.agh.thieves.common.Item;
import pl.edu.agh.thieves.common.Iteration;
import pl.edu.agh.thieves.common.OptimalSolution;

public class OptimalSolutionFirefly implements OptimalSolution {

	@Override
	public void setItems(ArrayList<Item> items) {
		this.items.addAll(items);
	}

	@Override
	public ArrayList<Item> getItems() {
		return items;
	}

	@Override
	public void setTimeOfAll(long time) {
		timeofall = time;
	}

	@Override
	public long getTimeOfAll() {
		return timeofall;
	}

	@Override
	public void setTimeUntilBestIteration(long time) {
		timeuntilbestiteration = time;
	}

	@Override
	public long getTimeUntilBestIteration() {
		return timeuntilbestiteration;
	}
        
	@Override
	public void setListOfAllIterations(ArrayList<Iteration> iterations){
		totalvalueofiniteration.addAll(iterations);
	}
        
	@Override
	public ArrayList<Iteration> getListOfAllIterations(){
		return totalvalueofiniteration;
	}
        
	@Override
	public void setNumberOfBestIteration(int iteration){
		optimalresultiteration = iteration;
	}
        
	@Override
	public int getNumberOfBestIteration(){
		return optimalresultiteration;
	}
      
	public OptimalSolutionFirefly(ArrayList<Item> items, ArrayList<Iteration> iterations, long timeOfAll, long timeUntilBestIteration, int optimalResultIteration){
		setItems(items);
		totalvalueofiniteration = iterations;
		this.optimalresultiteration = optimalResultIteration;
		this.timeofall = timeOfAll;
		this.timeuntilbestiteration = timeUntilBestIteration;
	}
	
	ArrayList<Item> items = new ArrayList<Item>();
	ArrayList<Iteration> totalvalueofiniteration = new ArrayList<Iteration>();
	int optimalresultiteration = 0;
	long timeofall = 0;
	long timeuntilbestiteration = 0;

}
